<template>
	<view class="box">
		<view class="box1">
			<view class="back" @click="back">
				<image src="@/static/image/后退.png"></image>
			</view>
			<view class="sousuo">
				<u-search shape="round" :clearabled="true" :animation="true" bg-color="#fff"></u-search>
				<view class="a1">
					搜索
				</view>
			</view>
			<view class="sort">
				<view class="left">
					满减优惠
				</view>
				<view class="center">
					再买69.2可享用
				</view>
				<view class="right">
					满79减10
				</view>
			</view>
		</view>

		<view class="fenlei">
			<view class="fenlei1">
				<view class="fenlei1-content">
					全部分类
				</view>
				<image src="../../static/image/筛选.png" mode=""></image>
			</view>
			<view class="fenlei1">
				<view class="fenlei1-content">
					销量
				</view>
				<image src="../../static/image/筛选.png" mode=""></image>
			</view>
			<view class="fenlei1">
				<view class="fenlei1-content">
					价格
				</view>
				<image src="../../static/image/筛选.png" mode=""></image>
			</view>
		</view>
		<view class="zujian">
			<view class="for">
				<view v-for="item in content" :key="item.id" class="for-box">
					<shiqing :title="item.title" :title1="item.title1" :title2="item.title2" :title3="item.title3"
						:title4="item.title4" :title5="item.title5">
						<template #t1>
							券
						</template>
						<template #t2>
							减10元
						</template>
					</shiqing>
				</view>
			</view>
		</view>
		<button class="btn1" @click="nav">前往购物车</button>
	</view>
</template>

<script>
	import shiqing from '@/components/shiqing/shiqing.vue'
	export default {
		components: {
			shiqing
		},
		data() {
			return {
				content: [{
						id: 1,
						title: require('../../static/image/包子.png'),
						title1: '江苏无锡香菇猪肉包',
						title2: '猪肉肥美 | 鲜甜嫩软 | 多汁美味',
						title3: '多汁香嫩',
						title4: '8.79',
						title5: '笼',
						title6: '券',
						title7: '减10元'
					},
					{
						id: 2,
						title: require('../../static/image/包子.png'),
						title1: '浙江临海西蓝花',
						title2: '基地直供 | 绿色培植 | 新鲜采摘',
						title3: '绿色新鲜',
						title4: '4.79',
						title5: '斤'
					},
					{
						id: 3,
						title: require('../../static/image/包子.png'),
						title1: '云南高山大西红柿',
						title2: '鲜嫩多汁 | 软甜爽口 | 入口美味',
						title3: '美味多汁',
						title4: '2.44',
						title5: '斤'
					},
					{
						id: 4,
						title: require('../../static/image/包子.png'),
						title1: '宁夏西吉县马铃薯',
						title2: '基地直供 | 绿色配制 | 新鲜采摘',
						title3: '绿色新鲜',
						title4: '3.21',
						title5: '斤'
					}
				]
			}
		},
		methods: {
			back() {
				uni.navigateBack({
					url: '/pages/list/list'
				})
			},
			nav() {
				uni.switchTab({
					url: '/pages/shop/shop'
				})
			}
		}
	}
</script>

<style lang="scss">
	.box {
		background-color: #f8f8f8;
		.box1 {
			background-image: linear-gradient(#cdf1dd, #f8f8f8);
			height: 24vh;
			border-radius: 35rpx 35rpx 0 0;

			.back {
				image {
					padding-left: 2vh;
					width: 4vh;
					height: 4vh;
					margin-top: 5vh;
				}
			}

			.sousuo {
				width: 90%;
				margin: auto;
				padding-top: 3vh;
				position: relative;
				margin-bottom: 30rpx;
				.a1 {
					color: #fff;
					background-color: #49ba7c;
					border-radius: 40rpx;
					padding: 10rpx 35rpx;
					position: absolute;
					right: 0.5vh;
					bottom: 0.3vh;
				}
			}
			.sort {
				display: flex;
				width: 90%;
				margin: auto;
				background-color: #fff;
				height: 60rpx;
				padding: 10rpx;
				border-radius: 20rpx;
				.left {
					color: #e68c75;
					background-color: #fed5d2;
					height: 40rpx;
					line-height: 40rpx;
					font-size: 26rpx;
					width: 120rpx;
					text-align: center;
					border-radius: 10rpx;
				}
			
				.center {
					margin-left: 60rpx;
				}
			
				.right {
					margin-left: 60rpx;
				}
			}
		}

		

		.fenlei {
			display: flex;
			justify-content: space-around;
			margin-top: 20rpx;

			.fenlei1 {
				display: flex;
				font-weight: bold;
				.fenlei1-content{
					font-size: 34rpx;
				}
				image {
					width: 30rpx;
					height: 40rpx;
				}
			}	
		}

		.zujian {
			width: 90%;
			margin: auto;

			.for {
				margin-top: 10px;
				display: flex;
				width: 100%;
				flex-wrap: wrap;
				justify-content: space-between;

				.for-box {
					width: 48%;
					margin-top: 40rpx;
				}
			}
		}

		.btn1 {
			width: 90%;
			margin: auto;
			margin-bottom: 40px;
			background-color: #79d8a3;
			color: #fff;
			margin-top: 40rpx;
			border-radius: 10px;
		}
	}
</style>